package com.wzh.controll;

import com.wzh.pojo.Resp.DataResp;
import com.wzh.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Role")
public class RoleController {

    @Autowired
	private RoleService roleService;

	@PostMapping("/RoleShow")
	@ResponseBody
	public DataResp DelRouter(){
		DataResp<Object> resp= roleService.show();
		return resp;
	};

	@GetMapping("/AddRole")
	@ResponseBody
	public DataResp AddRole(@RequestParam("rid") Integer rid , @RequestParam("tid[]") Integer[] tid){
		System.out.println(rid);
		System.out.println(tid.length);
		DataResp<Object> resp= roleService.add(rid,tid);
		return resp;
	};
}
